package org.lw.springbootlw.common.Entity;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Employee {
    private Long id;
    private String name;
    private Long departmentId; // 外键关联
  //  @JsonBackReference   // 防止json序列化时无限递归
    @JsonManagedReference
    private Department department; // 多对一关系
}

